<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.text.DateFormat"%>
<%@page import="java.util.Date"%>
<%@page import="javabean.UserBean"%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <link href="../../CSS/Site1.css" type="text/css" rel="stylesheet"/>

    </head>
    <body>
        <div class="container">
            <div class="header">
                <div class="header_top_left">
                    <%
                        Date d = new Date();
                        DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyyy");

                        out.print(dateFormat.format(d));
                    %>
                </div>
                <div class="header_top_right">  
                    <%
                        UserBean user = (UserBean) session.getAttribute("userbean");
                        if (user.getUsername() != "") {
                            String username = user.getUsername();
                            out.print("Chào bạn " + username);
                        }
                    %>                    
                </div>
                <%--<div class="clear"></div>--%>

                <div class="clear"></div>             

                <div class="header_main" > <img src="../../Images/12855184861024648803.jpg"/></div>
               
            </div>


            <script type="text/javascript">
                <!--
                stm_bm(["menu4448",980,"","../../Menu/blank.gif",0,"","",0,0,500,0,1000,1,0,0,"","100%",0,0,1,2,"default","hand","",1,25],this);
                stm_bp("p0",[0,4,0,0,0,0,0,0,100,"",-2,"",-2,50,0,0,"#999999","transparent","../../Menu/line1.gif",3,0,0,"#000000"]);
                stm_ai("p0i0",[0,"Home","","",-1,-1,0,"/DeAn_WebTruyen/Home.jsp","_self","","","","",0,0,0,"","",0,0,0,1,1,"#E6EFF9",1,"#E6EFF9",1,"../../Menu/line.gif","../../Menu/line2.gif",3,3,0,0,"#E6EFF9","#000000","#045257","#7e4076","bold 8pt Verdana","bold 8pt Verdana",0,0,"../../Menu/left1.gif","../../Menu/left2.gif","../../Menu/right1.gif","../../Menu/right2.gif",14,19,37],150,20);
                stm_aix("p0i1","p0i0",[0,"Story List","","",-1,-1,0,"#"],150,20);
                stm_bp("p1",[1,4,0,0,5,0,5,0,100,"progid:DXImageTransform.Microsoft.Wipe(GradientSize=1.0,wipeStyle=1,motion=forward,enabled=0,Duration=0.30)",5,"",-2,80,0,0,"#CCCCCC","#b569ac","",3,0,0,"#CCCCCC","../../Menu/topline.gif",8,1,0,"transparent","../../Menu/topline.gif",3,"",-1,-1,0,"#b569ac","",3,"",-1,-1,0,"#b569ac","",3,"",-1,-1,0,"transparent","",3,"../../Menu/topleft.gif","../../Menu/topright.gif","","",10,8,11,8,20,20,20,20]);
                stm_ai("p1i0",[0,"Comedy","","",-1,-1,0,"","_self","","","","",5,1,0,"","",0,0,0,1,1,"363636",1,"#9d5995",0,"","",3,3,0,0,"#E6EFF9","#000000","#e5e5e5","#FFFFFF","8pt Verdana","8pt Verdana",0,0,"","","","",0,0,0],150,20);
                stm_aix("p1i1","p1i0",[0,"Action","","",-1,-1,0,"#","_self","","","","",5,1,0,"","",0,0,0,1,1,"#2b2b2b"],150,20);
                stm_aix("p1i2","p1i1",[0,"Comic"],150,20);
                stm_aix("p1i3","p1i1",[0,"Historical"],150,20);
                stm_aix("p1i4","p1i0",[0,"Magic"],150,20);
                stm_aix("p1i5","p1i1",[0,"Romance"],150,20);
                stm_aix("p1i6","p1i1",[0,"School life"],150,20);
                stm_aix("p1i7","p1i1",[0,"Adventure"],150,20);
                stm_ep();
                stm_aix("p0i2","p0i1",[0,"Upload"],150,0);
                stm_aix("p0i3","p0i1",[0,"Help","","",-1,-1,0,"#","_self","","Hướng dẫn upload ảnh"],150,0);
                stm_aix("p0i4","p0i0",[0,"About","","",-1,-1,0,"#About.jsp","_self","","Liên hệ"],150,0);
                stm_ep();
                stm_cf([0,0,0,"Main_frame","Navigation_frame",1]);
                stm_em();
                //-->
            </script>
            <%
                UserBean user1 = (UserBean) session.getAttribute("userbean");
                if (user1 == null || !user.getRole().equals("admin")) {
                    response.sendRedirect("./Login.jsp");
                }
            %>
            <form action="" method="POST">
                <h1>Admin Functions</h1>
                <a href="CreateUser.jsp">Create a new user</a><br>
                <a href="SearchUsers.jsp">Search user</a><br>
                <a href="/DeAn_WebTruyen/ListAllUserServlet">List users</a><br>
                <a href="/Home.jsp">Log out</a><br>

                <input type="submit" value="Servlet" />
            </form>
    </body>
</html>
